package com.ziyun.pop.common.api.DianWoDa;

import org.apache.commons.collections.map.UnmodifiableMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;

/**
 * @author guizhao
 * @Title: DianWoDaCityCode
 * @ProjectName jeesite
 * @Description: 点我达城市编码
 * @date 2018-07-259:58
 */
public class DianWoDaCityCode {

    /**
     * 日志对象
     */
    private static Logger logger = LoggerFactory.getLogger(DianWoDaCityCode.class);

    /**
     * 城市编码
     */
    private static final Map<String,String> CityCodeMap;

    static {
        Map<String,String> cityMap = new HashMap<>();
        cityMap.put("杭州市","330100");         cityMap.put("南京市","320100");        cityMap.put("上海市","310100");
        cityMap.put("武汉市","420100");        cityMap.put("济南市","370100");        cityMap.put("郑州市","410100");
        cityMap.put("长沙市","430100");        cityMap.put("成都市","510100");        cityMap.put("深圳市","440300");
        cityMap.put("西安市","610100");        cityMap.put("重庆市","500100");        cityMap.put("北京市","110100");
        cityMap.put("青岛市","370200");        cityMap.put("天津市","120100");        cityMap.put("厦门市","350200");
        cityMap.put("温州市","330300");        cityMap.put("宁波市","330200");        cityMap.put("福州市","350100");
        cityMap.put("广州市","440100");        cityMap.put("苏州市","320500");        cityMap.put("无锡市","320200");
        cityMap.put("常州市","320400");        cityMap.put("东莞市","441900");        cityMap.put("佛山市","440600");
        cityMap.put("合肥市","340100");        cityMap.put("临沂市","371300");        cityMap.put("绍兴市","330600");
        cityMap.put("石家庄市","130100");        cityMap.put("保定市","130600");        cityMap.put("金华市","330700");
        cityMap.put("汕头市","440500");        cityMap.put("九江市","360400");        cityMap.put("珠海市","440400");
        cityMap.put("南昌市","360100");        cityMap.put("昆明市","530100");        cityMap.put("南通市","320600");
        cityMap.put("芜湖市","340200");        cityMap.put("南宁市","450100");        cityMap.put("长春市","220100");
        cityMap.put("扬州市","321000");        cityMap.put("嘉兴市","330400");        cityMap.put("湖州市","330500");
        cityMap.put("大连市","210200");        cityMap.put("沈阳市","210100");        cityMap.put("乌鲁木齐市","650100");
        cityMap.put("徐州市","320300");        cityMap.put("盐城市","320900");        cityMap.put("镇江市","321100");
        cityMap.put("烟台市","370600");        cityMap.put("威海市","371000");        cityMap.put("泉州市","350500");
        cityMap.put("惠州市","441300");        cityMap.put("台州市","331000");        cityMap.put("潍坊市","370700");
        cityMap.put("淄博市","370300");        cityMap.put("蚌埠市","340300");        cityMap.put("兰州市","620100");
        cityMap.put("太原市","140100");        cityMap.put("绵阳市","510700");        cityMap.put("贵阳市","520100");
        cityMap.put("海口市","460100");        cityMap.put("呼和浩特市","150100");        cityMap.put("酒泉市","620900");
        cityMap.put("平凉市","620800");        cityMap.put("天水市","620500");        cityMap.put("桂林市","450300");
        cityMap.put("柳州市","450200");        cityMap.put("玉林市","450900");        cityMap.put("遵义市","520300");
        cityMap.put("三亚市","460200");        cityMap.put("大庆市","230600");        cityMap.put("哈尔滨市","230100");
        cityMap.put("佳木斯市","230800");        cityMap.put("岳阳市","430600");        cityMap.put("株洲市","430200");
        cityMap.put("吉林市","220200");        cityMap.put("四平市","220300");        cityMap.put("松原市","220700");
        cityMap.put("鞍山市","210300");        cityMap.put("锦州市","210700");        cityMap.put("宝鸡市","610300");
        cityMap.put("汉中市","610700");        cityMap.put("渭南市","610500");        cityMap.put("延安市","610600");
        cityMap.put("榆林市","610800");        cityMap.put("德阳市","510600");        cityMap.put("内江市","511000");
        cityMap.put("宜宾市","511500");        cityMap.put("自贡市","510300");        cityMap.put("大理白族自治州","532900");
        cityMap.put("曲靖市","530300");        cityMap.put("昭通市","530600");        cityMap.put("安庆市","340800");
        cityMap.put("滁州市","341100");        cityMap.put("阜阳市","341200");        cityMap.put("马鞍山市","340500");
        cityMap.put("宿州市","341300");        cityMap.put("龙岩市","350800");        cityMap.put("宁德市","350900");
        cityMap.put("莆田市","350300");        cityMap.put("潮州市","445100");        cityMap.put("江门市","440700");
        cityMap.put("茂名市","440900");        cityMap.put("梅州市","441400");        cityMap.put("清远市","441800");
        cityMap.put("湛江市","440800");        cityMap.put("肇庆市","441200");        cityMap.put("沧州市","130900");
        cityMap.put("承德市","130800");        cityMap.put("廊坊市","131000");        cityMap.put("邢台市","130500");
        cityMap.put("张家口市","130700");        cityMap.put("开封市","410200");        cityMap.put("濮阳市","410900");
        cityMap.put("黄石市","420200");        cityMap.put("荆门市","420800");        cityMap.put("襄阳市","420600");
        cityMap.put("宜昌市","420500");        cityMap.put("宿迁市","321300");        cityMap.put("上饶市","361100");
        cityMap.put("德州市","371400");        cityMap.put("日照市","371100");        cityMap.put("咸阳市","610400");
        cityMap.put("丽水市","331100");        cityMap.put("衢州市","330800");        cityMap.put("舟山市","330900");
        cityMap.put("漳州市","350600");        cityMap.put("中山市","442000");

        CityCodeMap = UnmodifiableMap.decorate(cityMap);
    }

    /**
     * 根据城市名，获取城市编码
     * @param city
     * @return
     */
    public  static String getCityCode(String city){
        String code = CityCodeMap.get(city.trim());
        logger.info(code);
        return code;
    }

   /* public static void main(String[] args) {
        DianWoDaCityCode.getCityCode("漳州市");
    }*/
}
